home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_powervoice.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  150 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHW_PowerVoice.cog
  4. #
  5. # Say line control for the first area in SHW
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols        
  13.     
  14.     # MESSAGES
  15.     message     startup
  16.     message     crossed
  17.     
  18.     # ACTORS
  19.     thing       player      local
  20.     thing       indyActor   
  21.     
  22.     # CAMAERA TARGETS
  23.     thing    camtarg
  24.  
  25.     # CAMERA OBJECTS
  26.     thing       lCampos     
  27.     thing       rCampos
  28.     thing         curCam    local
  29.  
  30.     # TRIGGERS
  31.     surface     triggersurf     linkID=1
  32.     surface     triggersurf1    linkID=2
  33.     
  34.     # SAYLINES
  35.     sound       inwheelspot=sw01j03.wav      local       # a water wheel and...
  36.     
  37.     # CONTROL VARS
  38.     int wheelspotted=0    local
  39.     
  40. end
  41.  
  42. # ========================================================================================
  43.  
  44. code
  45.  
  46. startup:
  47.  
  48.     player = GetLocalPlayerThing();
  49.     return;
  50.     
  51. # ========================================================================================
  52.  
  53. crossed:
  54.  
  55.     if (wheelspotted == 1) return;
  56.  
  57.     StartCutscene(1);
  58.     StopThing(player);
  59.  
  60.     curCam = GetCurrentCamera();
  61.     SetCameraLookInterp(2, 1);
  62.     SetCameraInterpSpeed(2, 3);
  63.     
  64.     if ((GetSenderID() == 1) && (GetSourceRef() == player))    #player comes up left ramp
  65.         {    
  66.             #Sleep(0.25);
  67.             # Swing Cam to the lCampos
  68.             SetExtCamOffsetToThing(lCampos);
  69.             
  70.             # Hide and disable player, show indyActor
  71.             TeleportThing(indyActor, player);
  72.             ClearThingFlags(indyActor, 0x80000);
  73.             SetThingFlags(player, 0x80000);
  74.             
  75.             # indyActor looks at the wheel
  76.             AISetLookThing(indyActor, camtarg);
  77.             
  78.             # "hmmm...a waterwheel and 4..."
  79.             PlayVoice(player, inwheelspot, 1.0, 0);
  80.             
  81.             Sleep(1.5);
  82.  
  83.             # put camera 2 at the curCam
  84.             SetCameraFocus(2, lCampos);
  85.             SetCameraSecondaryFocus(2, indyActor);
  86.             
  87.             SetCurrentCamera(2);
  88.             # camera pans over to the wheel
  89.             SetCameraLookInterp(2, 1);
  90.             SetCameraInterpSpeed(2, 3);
  91.             SetCameraSecondaryFocus(2, camtarg);
  92.             
  93.             sleep(1.0);
  94.             SetCameraPosition(1, GetThingPos(lCampos));
  95.             SetCurrentCamera(1);
  96.             RestoreExtCam();
  97.         }
  98.  
  99.  
  100.         if ((GetSenderID() == 2) && (GetSourceRef() == player))    # player comes upo right ramp
  101.         {    
  102.             #Sleep(0.25);
  103.             # Swing Cam to the rCampos
  104.             SetExtCamOffsetToThing(rCampos);
  105.             
  106.             # Hide and disable player, show indyActor
  107.             TeleportThing(indyActor, player);
  108.             SetThingFlags(player, 0x80000);
  109.             ClearThingFlags(indyActor, 0x80000);
  110.             
  111.             # indyActor looks at the wheel
  112.             AISetLookThing(indyActor, camtarg);
  113.             
  114.             # "hmmm...a waterwheel and 4..."
  115.             PlayVoice(player, inwheelspot, 1.0, 0);
  116.             
  117.             Sleep(1.5);
  118.  
  119.             # put camera 2 at the curCam
  120.             SetCameraFocus(2, rCampos);
  121.             SetCameraSecondaryFocus(2, indyActor);
  122.             SetCurrentCamera(2);
  123.             
  124.             # camera pans over to the wheel
  125.             SetCameraLookInterp(2, 1);
  126.             SetCameraInterpSpeed(2, 3);
  127.             SetCameraSecondaryFocus(2, camtarg);
  128.             
  129.             
  130.             
  131.             sleep(1.0);
  132.             SetCameraPosition(1, GetThingPos(rCampos));
  133.             SetCurrentCamera(1);
  134.             RestoreExtCam();
  135.         }
  136.     # Return player
  137.     TeleportThing(player, indyActor);
  138.     ClearThingFlags(player, 0x80000);
  139.     SetThingFlags(indyActor, 0x80000);
  140.     wheelspotted = 1;
  141.     SetCurrentCamera(1);
  142.     SetCameraLookInterp(2, 0);
  143.     EndCutscene();
  144.     return;
  145.  
  146. # ========================================================================================
  147.     
  148. end
  149.  
  150.